<?php

/**
 * Gets all the flash messages including the current messages
 *
 * @author    Mon Zafra <monzee at gmail>
 * @copyright (c)2009 Mon Zafra
 * @license   http://monzee.wordpress.com/license New BSD
 * @version   $Id: GetAllFlashMessages.php 38 2009-02-18 17:12:39Z monzee $
 */
class Mz_Helper_View_GetAllFlashMessages
{
    public function getAllFlashMessages()
    {
        $flash = Zend_Controller_Action_HelperBroker::getStaticHelper('flashMessenger');
        $msgs = '<p>' . PHP_EOL
              . implode("</p>\n<p>", $flash->getCurrentMessages() + $flash->getMessages())
              . '</p>' . PHP_EOL;
        $flash->clearCurrentMessages();
        $flash->clearMessages();
        return $msgs;
    }
    
}
